package org.example.examsystem.controller;


import org.example.examsystem.entity.Paper;
import org.example.examsystem.service.PaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/papers")
public class PaperController {

    @Autowired
    private PaperService paperService;

    @GetMapping("/{eid}")
    public List<Paper> getPaperDetailsByEid(@PathVariable Integer eid) {
        return paperService.getPaperDetailsByEid(eid);
    }
    @PostMapping
    public void savePaper(@RequestBody Paper paper) {
        paperService.savePaper(paper);
    }
}